<?php
/**
 * Joomla! 1.5 component JoomGPSTracks
 *
 * @version $Id: joomgpstracks.php 2009-06-24 15:40:19 svn $
 * @author Michael Pfister
 * @package joomGPStracks
 * @subpackage backend
 * @license GNU/GPL
 * @filesource
 * 
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

/*
 * Define constants for all pages
 */
define( 'COM_JOOMGPSTRACKS_DIR', 'images'.DS.'joomgpstracks'.DS );
define( 'COM_JOOMGPSTRACKS_BASE', JPATH_ROOT.DS.COM_JOOMGPSTRACKS_DIR );
define( 'COM_JOOMGPSTRACKS_BASEURL', JURI::root().str_replace( DS, '/', COM_JOOMGPSTRACKS_DIR ));

// Require the base controller
require_once JPATH_COMPONENT.DS.'controller.php';

require_once JPATH_COMPONENT.DS.'helpers'.DS.'helper.php';

// Initialize the controller
if($controller = JRequest::getWord('controller')) {
    $path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
    if (file_exists($path)) {
        require_once $path;
    } else {
        $controller = '';
    }
}

$classname    = 'JoomgpstracksController'.$controller;
$controller   = new $classname( );

$controller->execute( JRequest::getCmd( 'task' ) );

// Redirect if set by the controller
$controller->redirect();

?>